<template>
    <div class="NoticeSwiper">
        <div class="NoticeName fn-left">
           <p>公告</p>
        </div>
        <div>
            <!-- 公告样式 -->
            <div class="swiper-notice fn-left">
                <div class="swiper-wrapper">
                    <div class="swiper-slide stop-swipin">
                        <div class="Notice-content">
                            八周年庆典活动通知...
                        </div>
                       
                    </div>
                </div>
            </div>
        </div>
        <div class="NoticeShow fn-right" v-on:click="openRouter('NoticeList')">
            <span>更多</span>
        </div>
    </div>
</template>
<script>
import "./../assets/css/Notice.css"
export default {
    name: "NoticeSwiper",
    data: function() {
        return {
            model: [],
        }
    },
    methods: {
        //打开公告列表页
        openRouter: function() {
            this.$ddapi.openLink('http://meinian.minyuecloud.com/mob/')
        },

        //打开公告详情页面
        openArticle: function(id) {
            this.$ddapi.openLink('http://meinian.minyuecloud.com/mob/?showmenu=false#/NoticeDetails?message=5981837c11bdb327f62de24d')
        },

        //加载公告
        noticeLoad: function() {
            this.$http.get('http://meinian.minyuecloud.com/mob/api/out/title_top').then(res => {
               alert(res)
                this.model = res.body
                alert(this.model)
            }, err => {
                // alert(JSON.stringify(err))
            })
        }
    },
    mounted: function() {
    //     let _self = this;
    //     //当页面重新可见时

    //     document.addEventListener('resume', function() {
    //         _self.noticeLoad();
    //     });

    //     var swiper = new Swiper('.swiper-notice', {
    //         paginationClickable: true,
    //         direction: 'vertical',
    //         autoHeight: true,
    //         calculateHeight: true,
    //         autoplay: 2000,
    //         loop: true,
    //         observer: true,//修改swiper自己或子元素时，自动初始化swiper
    //         observeParents: true,//修改swiper的父元素时，自动初始化swiper
    //         noSwiping: true,
    //         cssWidthAndHeight: true,
    //         noSwipingClass: 'stop-swipin'
    //     });


     },
    created: function() {
        this.noticeLoad();


    },
}
</script>
<style>
.swiper-notice .swiper-wrapper .swiper-slide {
   
    height: 2.3rem !important;
}
</style>
